ostree-repo-static-delta-processing: Don't close(-1)
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 21 Nov 2016 23:10:24 +0000 (15:10 -0800)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 22 Nov 2016 02:32:33 +0000 (02:32 +0000)
Ultimately harmless, but causes somewhat scary strace messages.

Closes: #591
Approved by: cgwalters

src/libostree/ostree-repo-static-delta-processing.c

index 95f9ddbab717126221f4e0956f4c26b0606dc1ea..eabe392585b7e503a2d2a235deceef413a2e30a4 100644 (file)
@@ -842,7 +842,7 @@ dispatch_set_read_source (OstreeRepo                 *repo,
   gboolean ret = FALSE;
   guint64 source_offset;
 
-  if (state->read_source_fd)
+  if (state->read_source_fd != -1)
     {
       (void) close (state->read_source_fd);
       state->read_source_fd = -1;
@@ -887,7 +887,7 @@ dispatch_unset_read_source (OstreeRepo                 *repo,
       goto out;
     }
 
-  if (state->read_source_fd)
+  if (state->read_source_fd != -1)
     {
       (void) close (state->read_source_fd);
       state->read_source_fd = -1;